home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 22 / PCPP #22.iso / Quake2 / q2source_12_11 / utils3 / qe4 / cmdlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  1.8 KB  |  78 lines

  1. // cmdlib.h
  2.  
  3. #ifndef __CMDLIB__
  4. #define __CMDLIB__
  5.  
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <stdlib.h>
  9. #include <errno.h>
  10. #include <ctype.h>
  11. #include <time.h>
  12. #include <stdarg.h>
  13.  
  14. #ifndef __BYTEBOOL__
  15. #define __BYTEBOOL__
  16. typedef enum {false, true} qboolean;
  17. typedef unsigned char byte;
  18. #endif
  19.  
  20. // the dec offsetof macro doesn't work very well...
  21. #define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier)
  22.  
  23.  
  24. // set these before calling CheckParm
  25. extern int myargc;
  26. extern char **myargv;
  27.  
  28. int Q_strncasecmp (char *s1, char *s2, int n);
  29. int Q_strcasecmp (char *s1, char *s2);
  30.  
  31. int Q_filelength (FILE *f);
  32.  
  33. double I_FloatTime (void);
  34.  
  35. void    Error (char *error, ...);
  36. int        CheckParm (char *check);
  37. void ParseCommandLine (char *lpCmdLine);
  38.  
  39. FILE    *SafeOpenWrite (char *filename);
  40. FILE    *SafeOpenRead (char *filename);
  41. void    SafeRead (FILE *f, void *buffer, int count);
  42. void    SafeWrite (FILE *f, void *buffer, int count);
  43.  
  44. int        LoadFile (char *filename, void **bufferptr);
  45. int        LoadFileNoCrash (char *filename, void **bufferptr);
  46. void    SaveFile (char *filename, void *buffer, int count);
  47.  
  48. void     DefaultExtension (char *path, char *extension);
  49. void     DefaultPath (char *path, char *basepath);
  50. void     StripFilename (char *path);
  51. void     StripExtension (char *path);
  52.  
  53. void     ExtractFilePath (char *path, char *dest);
  54. void    ExtractFileName (char *path, char *dest);
  55. void     ExtractFileBase (char *path, char *dest);
  56. void    ExtractFileExtension (char *path, char *dest);
  57.  
  58. int     ParseNum (char *str);
  59.  
  60. short    BigShort (short l);
  61. short    LittleShort (short l);
  62. int        BigLong (int l);
  63. int        LittleLong (int l);
  64. float    BigFloat (float l);
  65. float    LittleFloat (float l);
  66.  
  67.  
  68. char *COM_Parse (char *data);
  69.  
  70. extern    char        com_token[1024];
  71. extern    qboolean    com_eof;
  72.  
  73. #define    MAX_NUM_ARGVS    32
  74. extern    int        argc;
  75. extern    char    *argv[MAX_NUM_ARGVS];
  76.  
  77. #endif
  78.